function demoDrawableArcs(delay)
% Demonstrate drawing one or more circular arcs, allow visual inspection.

if nargin < 1
    delay = 2;
end

% access the manager that deals with drawing
dotsTheDrawablesManager.reset();
dm = dotsTheDrawablesManager.theObject;
dm.openScreenWindow;

% create an arcs object and add it to an arbitrary group
arc = dm.newObject('dotsDrawableArcs');
group = 'demo';
dm.addObjectToGroup(arc, group);
dm.activateGroup(group);

% draw one coarse arc
arc.x = 0;
arc.y = 0;
arc.sweepAngle = 180;
arc.color = [0 128 64];
arc.nSlices = 10;
dm.mayDrawNextFrame;
pause(delay);

% draw one smooth arc
arc.nSlices = 100;
dm.mayDrawNextFrame;
pause(delay);

% draw several smooth arcs
n = 5;
arc.x = zeros(1,n);
arc.y = zeros(1,n);
arc.startAngle = linspace(0, 270, n);
arc.sweepAngle = 20*ones(1,n);
arc.radius = linspace(5, 10, n);
arc.width = linspace(1, 2, n);
dm.mayDrawNextFrame;
pause(delay);

% draw colorful arcs
arc.color = autumn(5)';
dm.mayDrawNextFrame;
pause(delay);

% set width in pixels, which might be natural sometimes
pixelWidths = linspace(1, 10, n);
arc.width = dm.pixelSizeToDegrees(pixelWidths);
dm.mayDrawNextFrame;
pause(delay);

% try to smooth the arc edges
arc.smooth = true;
dm.mayDrawNextFrame;
pause(delay);

% close the OpenGL drawing window
dm.closeScreenWindow;